import request from '@/utils/request'

// 产量分日统计
export function yieldDataDay(query) {
  return request({
    url: '/mes/pro/statics/list',
    method: 'get',
    params: query
  })
}

// 实时产量统计
export function yieldCalYield(query) {
  return request({
    url: '/mes/pro/yield/calYield',
    method: 'get',
    params: query
  })
}

// http://localhost:8080/mes/pro/yield/calYield

// http://192.168.37.19/dev-api/xinfuxing-mes/MesColdYieldReport/list
// {"params":{"beginTime":"2025-05-20 00:00:00","endTime":"2025-05-25 23:59:59","sort":"DESC"}}
// xinfuxing接口
// this.queryParams.params.endTime = dayjs(thisTime).format('YYYY-MM-DD') + ' 23:59:59';
// 班报 产量分班组统计
export function yieldData(data) {
  return request({
    url: '/xinfuxing-mes/MesColdYieldReport/list',
    method: 'post',
    data: data
  })
}

// 自定义时间查询
export function yieldDataTime(query) {
  return request({
    url: '/xinfuxing-mes/MesColdYieldReport/calColdYieldReportAllLineFromGlasses',
    method: 'get',
    params: query
  })
}

// 查询报表产量详细 小时报 24小时版 新福兴 查单日 小时报
// params[beginTime]=20250504060000 params[endTime]=20250504060000
export function linesHoursStatic(data) {
  return request({
    url: 'xinfuxing-mes/MesColdHoursStatics/list',
    method: 'post',
    data: data
  })
}
// 查询报表产量详细 小时报详细数据 新福兴
// params[beginTime]=20250504060000 params[endTime]=20250504060000
export function linesHoursYieldStatic(data) {
  return request({
    url: 'xinfuxing-mes/MesColdHoursYieldStatics/list',
    method: 'post',
    data: data
  })
}

// ======================================================================
// 修改报表产量详细 小时报 24小时版
// 手填更新data 返回msg 请求 主键 staticsId
export function linesHoursStaticEdit(data) {
  return request({
    url: 'xinfuxing-mes/MesColdHoursStatics',
    method: 'put',
    data: data
  })
}
// 修改报表产量详细 小时报详细数据 24小时版
// 手填更新data 返回msg 请求 主键 staticsId
export function linesHoursYieldStaticEdit(data) {
  return request({
    url: 'xinfuxing-mes/MesColdHoursYieldStatics',
    method: 'put',
    data: data
  })
}

// test
// 查询报表产量详细 小时报 24小时版
// params%5BbeginTime%5D=20240921000000&params%5BendTime%5D=20240921230000
export function linesColdStatic(query) {
  return request({
    url: 'mes/MesColdHoursStatic/list',
    method: 'get',
    params: query
  })
}

// 优化查询 分白晚 分线
// params%5BbeginTime%5D=20240921000000&params%5BendTime%5D=20240921230000
export function yieldOpStaticList(data) {
  return request({
    url: 'xinfuxing-mes/MesColdYieldOpStatic/list',
    method: 'post',
    data: data
  })
}

// 查询报表产量详细 日报 新福兴
// params[beginTime]=20250504060000 params[endTime]=20250504060000
export function linesDailyStatic(data) {
  return request({
    url: 'xinfuxing-mes/MesColdDaysStatics/list',
    method: 'post',
    data: data
  })
}
